/*
 * @Author: xiaoyan
 * @Date: 2021-11-26 16:52:28
 * @LastEditors: xiaoyan
 * @LastEditTime: 2022-02-17 10:07:47
 * @Description: 
 * @FilePath: \user_auth_front\src\api\index.ts
 */
import {request} from '@/utils/request'

const apiUrl = process.env.REACT_APP_URL_API;

//用户登录
export function login(data:Object) {
    return request({
        url: `${apiUrl}/login`,
        method: 'post',
        data,
    })
}

//机构管理
//新增
export function organizationAdd(data:Object){
    return request({
        url:`${apiUrl}/organization/add`,
        method:'post',
        data,
    })
}
//查询列表
export function organizationList(data:Object){
    return request({
        url:`${apiUrl}/organization/list`,
        method:'post',
        data,
    })
}
//修改
export function organizationUpdate(data:Object){
    return request({
        url:`${apiUrl}/organization/update`,
        method:'post',
        data,
    })
}
//删除
export function organizationDel(data:Object){
    return request({
        url:`${apiUrl}/organization/del`,
        method:'post',
        data,
    })
}
//批量删除
export function organizationDels(data:Object){
    return request({
        url:`${apiUrl}/organization/dels`,
        method:'post',
        data,
    })
}
//机构详情
export function organizationDetail(params:Object){
    return request({
        url:`${apiUrl}/organization/detail`,
        method:'get',
        params,
    })
}
//机构列表，不分页
export function organizationListAll(){
    return request({
        url:`${apiUrl}/organization/listAll`,
        method:'get',
    })
}

//用户管理
//新增
export function userAdd(data:Object){
    return request({
        url:`${apiUrl}/user/add`,
        method:'post',
        data,
    });
}
//删除
export function userDel(data:Object){
    return request({
        url:`${apiUrl}/user/del`,
        method:'post',
        data,
    })
}
//批量删除
export function userDels(data:Object){
    return request({
        url:`${apiUrl}/user/dels`,
        method:'post',
        data,
    })
}
//用户详情
export function userDetail(params:Object){
    return request({
        url:`${apiUrl}/user/detail`,
        method:'get',
        params,
    })
}
//查询列表 
export function userList(data:Object){
    return request({
        url:`${apiUrl}/user/list`,
        method:'post',
        data,
    })
}
//修改
export function userUpdate(data:Object){
    return request({
        url:`${apiUrl}/user/update`,
        method:'post',
        data,
    })
}

//应用管理
//新增
export function applicationAdd(data:Object){
    return request({
        url:`${apiUrl}/application/add`,
        method:'post',
        data,
    });
}
//删除
export function applicationDel(data:Object){
    return request({
        url:`${apiUrl}/application/del`,
        method:'post',
        data,
    })
}
//批量删除
export function applicationDels(data:Object){
    return request({
        url:`${apiUrl}/application/dels`,
        method:'post',
        data,
    })
}
//应用详情
export function applicationDetail(params:Object){
    return request({
        url:`${apiUrl}/application/detail`,
        method:'get',
        params,
    })
}
//查询列表
export function applicationList(data:Object){
    return request({
        url:`${apiUrl}/application/list`,
        method:'post',
        data,
    })
}
//应用列表，不分页
export function applicationListAll(params:Object){
    return request({
        url:`${apiUrl}/application/listAll`,
        method:'get',
        params,
    })
}
//修改
export function applicationUpdate(data:Object){
    return request({
        url:`${apiUrl}/application/update`,
        method:'post',
        data,
    })
}

//菜单管理
//新增
export function menuAdd(data:Object){
    return request({
        url:`${apiUrl}/menu/add`,
        method:'post',
        data,
    });
}
//删除
export function menuDel(data:Object){
    return request({
        url:`${apiUrl}/menu/del`,
        method:'post',
        data,
    })
}
//批量删除
export function menuDels(data:Object){
    return request({
        url:`${apiUrl}/menu/dels`,
        method:'post',
        data,
    })
}
//菜单详情
export function menuDetail(params:Object){
    return request({
        url:`${apiUrl}/menu/detail`,
        method:'get',
        params,
    })
}
//查询列表
export function menuList(data:Object){
    return request({
        url:`${apiUrl}/menu/list`,
        method:'post',
        data,
    })
}
//修改
export function menuUpdate(data:Object){
    return request({
        url:`${apiUrl}/menu/update`,
        method:'post',
        data,
    })
}
//角色管理
//新增
export function roleAdd(data:Object){
    return request({
        url:`${apiUrl}/role/add`,
        method:'post',
        data,
    });
}
//删除
export function roleDel(data:Object){
    return request({
        url:`${apiUrl}/role/del`,
        method:'post',
        data,
    })
}
//批量删除
export function roleDels(data:Object){
    return request({
        url:`${apiUrl}/role/dels`,
        method:'post',
        data,
    })
}
//角色详情
export function roleDetail(params:Object){
    return request({
        url:`${apiUrl}/role/detail`,
        method:'get',
        params,
    })
}
//查询列表
export function roleList(data:Object){
    return request({
        url:`${apiUrl}/role/list`,
        method:'post',
        data,
    })
}
//角色列表，不分页
export function roleListAll(){
    return request({
        url:`${apiUrl}/role/listAll`,
        method:'get',
    })
}
//修改
export function roleUpdate(data:Object){
    return request({
        url:`${apiUrl}/role/update`,
        method:'post',
        data,
    })
}